package com.moon.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.moon.entity.Admin;
import com.moon.dao.AdminMapper;

import java.util.List;

@Transactional
@Service
public class AdminService {
	@Autowired
	private AdminMapper adminMapper;

	public AdminMapper getAdminMapper() {
		return adminMapper;
	}

    public Admin selectByAccountAndPassword(String account, String password) {
		Admin admin = new Admin();
		admin.setAccount(account);
		admin.setPassword(password);
		return adminMapper.selectOne(admin);
    }

    public List<Admin> selectAll() {
		return adminMapper.selectAll();
    }
}